#include<iostream>
#include<cmath>
#include "coordin.hpp"
polar rect_to_polar(rect xypos)
{
    using namespace std;
    polar answer;
    answer.distance = sqrt(xypos.x*xypos.x+xypos.y*xypos.y);
    if(xypos.x == 0)
        answer.angle = 0;
    else
        answer.angle = xypos.y/xypos.x;
    return answer;
}
void show_polar(polar p)
{
    using namespace std;
    const double Red_to_deg = 57.29;
    cout<<"distance = "<<p.distance<<endl;
    cout<<"angle = "<<p.angle*Red_to_deg<<" degree";

}
